package com.gzbd.login.jwt;


import java.io.Serializable;

/**
 * 返回时封装
 * <p>
 * 响应结果消息
 */

public class ResponseMessage<T> implements Serializable {


    private int code;


    private String msg;


    private T result;


    private long timestamp;


    public ResponseMessage() {
    }

    public ResponseMessage(int code, String msg, T data, long timestamp) {
        this.code = code;
        this.msg = msg;
        this.result = data;
        this.timestamp = timestamp;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public T getResult() {
        return result;
    }

    public long getTimestamp() {
        return timestamp;
    }

    @Override
    public String toString() {
        return "ResponseMessage{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + result +
                ", timestamp=" + timestamp +
                '}';
    }
}
